package fauxman.interfaces;

import java.awt.Point;
import java.util.Collection;

import fauxman.model.WorldModel;
import fauxman.StaticElements.PlayableArea;

public abstract class MoveableElement extends DynamicElement {
	protected Point lookAhead;
	private int[] currentDirection = {0,0};
	private int[] nextDirection = {0,0};
	
	public abstract boolean isCollisionNecessary();
	
	public abstract Collection<? extends PlayableArea> getPlayableArea();
	
	public int[] getNextDirection(WorldModel model){
		return nextDirection;
	}
	
	public int[] getNextDirection(){
		return nextDirection;
	}
	
	
	public int[] getCurrentDirection(){
		return currentDirection;
	}
	
	public void setCurrentDirection(int[] dir){
		currentDirection[0] = dir[0];
		currentDirection[1] = dir[1];
	}
	
	public void setNextDirection(int[] dir){
		nextDirection[0] = dir[0];
		nextDirection[1] = dir[1];
	}
	
	public void setLookAhead(Point lookAhead){
		this.lookAhead.setLocation(lookAhead);
	}
	public Point getLookAhead(){
		return lookAhead;
	}
	
	//Returns the updated direction that resulted from this position.  Returns null if this continous position didnt change the position.
	public int[] reactToCurrentContinuousPosition(){
		return null;
	}

	public void reactToCurrentDiscretePosition() {
		// Leave this blank so we can override it in Ghost
		// Not used in Bonus or Fauxman
	}
}
